<template>
  <div>
    <div class="title">热销推荐</div>
    <ul class="rec-list">
      <router-link
        :to="`/detail/${item.id}`"
        tag="li"
        class="rec-li border-bottom"
        v-for="item in list"
        :key="item.id"
      >
        <img :src="item.imgUrl" alt="" />
        <div class="item-info">
          <p class="item-title">{{ item.title }}</p>
          <p class="item-desc">{{ item.desc }}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'RecommendHome',
  props: ['list'],
  data() {
    return {}
  },

  mounted() {},

  methods: {}
}
</script>

<style lang="less" scoped>
.title {
  margin-top: 0.2rem;
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}
.rec-list {
  display: flex;
  flex-direction: column;
  .rec-li {
    padding: 0.5333rem;
    box-sizing: border-box;
    display: flex;
  }

  img {
    width: 1.7rem;
    height: 1.7rem;
  }
  .item-info {
    border: 1px solid gold;
    flex: 1;
    margin-left: 0.3333rem;
    .item-title {
      line-height: 0.54rem;
      font-size: 0.43rem;
    }

    .item-desc {
      line-height: 0.4rem;
      color: #ccc;
    }
    .item-button {
      margin-top: 0.16rem;
      background: #ff9300;
      padding: 0 0.25rem;
      border-radius: 0.06rem;
      color: #fff;
    }
  }
}
</style>
